package net.asfun.jvalog.view;

import java.util.ArrayList;
import java.util.List;

import net.asfun.jvalog.domain.Page;

public class MenuInfo {

	private String url;
	private String name;
	private String alt;
	
	public MenuInfo() {}
	
	protected static List<MenuInfo> list() {
		List<MenuInfo> menus = new ArrayList<MenuInfo>();
		List<Page> pages = Page.listPublished();
		for(Page page : pages) {
			MenuInfo menu = new MenuInfo();
			menu.alt = page.getExcerpt();
			menu.name = page.getTitle();
			menu.url = page.getLink();
			menus.add(menu);
		}
		return menus;
	}
	
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getAlt() {
		return alt;
	}
	public void setAlt(String alt) {
		this.alt = alt;
	}
}
